#include <iostream>
#include <vector>
#define M 13	//hash size

using namespace std;

struct symbol
{
	string name;
	string type;
	string value;
}

struct node
{
	string status;
	symbol sym;
}

int hash_function(string key, int i)
{
	int key_length;
	int init_value;
	int map_value;

	key_length=key.length();
	init_value=key[0]-65

	mapvalue=(init_value+key_length+i)%M;
	return mapvalue;
}

int hash_init(M)
{
	int i;
	i = 0;
	while (i != M){
		struct node hash_table[i];
		hashtable[i].status = "NIL";
		hashtable[i].sym.name = "NIL";
		hashtable[i].sym.type = "NIL";
		hashtable[i].sym.value = "NIL";
		i++;
	}
}

void hash_insert(struct node *T,struct symbol *new_sym)
{
	int i;
	string key;
	int map_value;
	
	i=0;
	key=*sym.name;

	while(i!=M)	{
		map_value=hash_function(key,i);
		if (T[map_value].status=="NIL"||T[map_value].status=="DEL")
		{
			T[map_value].sym=*new_sym;
			T[map_value].status=="FIL";
		}
		return;
	}
	if (i==M)
	{
		cout<<"hash table overflower"<<endl;
	}
	return;
}

void hash_search(struct node *T,string key)
{
	int i;
	int map_value;

	i=0;

	while(i!=M) {
		map_value=hash_function(key,i);
		if (T[map_value].symbol.name==key&&T[map_value].status=="FIL");
		{
			return map_value;
		}
		i++
	}
	if (i==M)
	{
		cout<<"Symbol not found"<<endl;
	}
	return;
}

void enter_new_scope()
{
	cout << "New scope" << endl;
}

void leave_current_scope()
{
	cout << "Leave current scope" << endl;
}
